<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登陆页面</title>
<link rel="stylesheet" 
	href=${pageContext.servletContext.contextPath}/js/bootstrap.min.css>
	
<link rel="stylesheet" type="text/css" href=${pageContext.servletContext.contextPath}/themes/default/easyui.css>   
<link rel="stylesheet" type="text/css" href=${pageContext.servletContext.contextPath}/themes/icon.css> 
<link rel="stylesheet" type="text/css" href=${pageContext.servletContext.contextPath}/themes/bootstrap/easyui.css>  
<script type="text/javascript" src=${pageContext.servletContext.contextPath}/js/jquery.min.js></script>   
<script type="text/javascript" src=${pageContext.servletContext.contextPath}/js/jquery.easyui.min.js></script> 
<script type="text/javascript" src=${pageContext.servletContext.contextPath}/js/easyui-lang-zh_CN.js></script>
<script type="text/javascript"
	src=${pageContext.servletContext.contextPath}/js/bootstrap.min.js></script>
<style>
#win{
background:url(img/eee.png);
}
.panel-title{
background:url(img/ccc.png);
}
.aaaa div{font-size:18px}
</style>
</head>
<script>
$(function(){
	$("#bnlogin").click(function(){
		if($("#username").val()==""||$("#password").val()==""){
    		$.messager.alert('警告','用户名或者密码不能为空');
    		return;
    	}
    	$.ajax({
    		url:"login",
    		dataType:"json",
    		data:{uname:$("#username").val(),upsd:$("#password").val()},
    		type:'post',
    		success:function(r){
    			
    			if(r.msg==0){
    				//alert(r.msg)
    				$("#username").textbox('clear');
    				$("#password").textbox('clear');
    				$.messager.alert('警告','用户名或者密码错误'); 
    			}else{
    				location.href='mainM.jsp';
    			}
    		}
    	})
	})
	//登陆窗口
	$('#win').window({    
	    width:400,    
	    height:320,    
	    title:"登陆窗口",
	    draggable:true,
	    resizable:false,
	    collapsible:false,
	    minimizable:false,
	    maximizable:false,
	    border:false,
	    shadow:true,
	    closable:false
	});  
	//用户名验证框
	$('#username').textbox({    
	    iconCls:'icon-man', 
	    iconAlign:'left' ,
	    height:35,
	    prompt:'UserName...',
	    validType: 'equals'
}); 
	$.extend($.fn.validatebox.defaults.rules, {    
	    equals: {    
	        validator: function(value,param){ 
	        	var req=/^[a-z]+$/;
	            return req.test(value);    
	        },    
	        message: '用户名由小写字母组成'   
	    }    
	});  
	//密码验证框
	
	$('#password').textbox({    
	    iconCls:'icon-lock', 
	    iconAlign:'left' ,
	    height:35,
	    prompt:'Password...',
	   // buttonText:"登陆",
	  //  onClickButton:function(){
	   // }
	})
	
	
})
</script>
<body background="img/ddd.png">
<div  id="win" data-options="headerCls:'aaaa'">
<div align="center" style="margin-top: 70px">
<input id="username"   name="uname" style="width:250px;height: 80px">

<input id="password" type="password" name="upsd" style="width:250px;height: 80px">
</div>

<div style="position:absolute;top: 170px;left:80px">
<a href="zczh.jsp"><h5>注册账号</h5></a>
</div>
<div style="position:absolute;top: 170px;left:250px">
<a href="zhmm.jsp"><h5>找回密码</h5></a>
</div>
<br><br>
<div align="center">
<button id="bnlogin" class="btn btn-info" style="width: 250px">登陆</button>
</div>
</div>
</body>
</html>